package com.bat.conf;

import io.micrometer.core.instrument.MeterRegistry;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @program: parent
 * @description:
 * @author: zhoupengfei
 * @create: 2019-10-10 21:38
 **/
@Configuration
@Slf4j
public class PrometheusConf {
    @Bean
    MeterRegistryCustomizer<MeterRegistry> configurer(@Value("${spring.application.name}") String applicationName) {
        log.info("=========> bat:init PrometheusConf =========>");
        return (registry) -> registry.config().commonTags("application", applicationName);
    }
}